/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License,Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import TLV from '../models/TLVModel'

export class NFCData {
  NET_TAG_NOT_NET_DEVICE: string = "0"
  NET_TAG_NAN: string = "1" // 碰一碰无感配网（无需输入账号密码）
  NET_TAG_SOCKET: string= "2" // socket配网
  NET_TAG_BLE: string = "3" // 蓝牙配网

  productId: TLV
  nodeId: TLV
  devicePwd: TLV
  netTag: TLV
  apSSID: TLV
  apToken: TLV
  BLEMAC: TLV

  getDeviceId(): string {
    if (this.getProductId().length == 0 || this.getNodeId().length == 0) {
      return "";
    } else {
      return this.getProductId() + "_" + this.getNodeId();
    }
  }

  getProductId(): string {
    return this.productId.value;
  }

  setProductId(productId: TLV) {
    this.productId = productId;
  }

  getNodeId(): string
  {
    return this.nodeId.value;
  }

  setNodeId(nodeId: TLV) {
    this.nodeId = nodeId;
  }

  getDevicePwd(): string
  {
    return this.devicePwd.value;
  }

  setDevicePwd(devicePwd: TLV) {
    this.devicePwd = devicePwd;
  }

  getNetTag(): string
  {
    return this.netTag.value;
  }

  setNetTag(netTag: TLV) {
    this.netTag = netTag;
  }

  getApSSID(): string
  {
    return this.apSSID.value;
  }

  setApSSID(apSSID: TLV) {
    this.apSSID = apSSID;
  }

  getApToken(): string
  {
    return this.apToken.value;
  }

  setApToken(apToken: TLV) {
    this.apToken = apToken;
  }

  getBLEMAC(): string
  {
    return this.BLEMAC.value;
  }

  setBLEMAC(BLEMAC: TLV) {
    this.BLEMAC = BLEMAC;
  }
}
